package com.qyer.lxp.model.book.normal;

import com.qyer.lxp.common.framework.adapter.DateAdapter;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created by jiangping on 16/7/1.
 */
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class Book implements Serializable{
    private static final long serialVersionUID = 4958835426234051432L;

    /**
     * 力行的订单 cd
     */
    @XmlElement(name = "order-cd")
    private String orderCd;

    /**
     * 分销商的订单 refer
     */
    @XmlElement(name = "distributor-order-refer")
    private String distributorOrderRefer;

    /**
     * 最晚确认时间格式 :yyyy-mm-dd hh:mm:ss ,
     * 需在此时间之前确认,过时将返回确认失败,
     * 需重新预订
     */
    @XmlElement(name = "pay-time")
    @XmlJavaTypeAdapter(value = DateAdapter.class)
    private Date payTime;

    @XmlElementWrapper(name = "book-item-responses")
    @XmlElement(name = "book-item-response")
    private List<BookItemResponse> bookItemResponses;

    public String getOrderCd() {
        return orderCd;
    }

    public void setOrderCd(String orderCd) {
        this.orderCd = orderCd;
    }

    public String getDistributorOrderRefer() {
        return distributorOrderRefer;
    }

    public void setDistributorOrderRefer(String distributorOrderRefer) {
        this.distributorOrderRefer = distributorOrderRefer;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public List<BookItemResponse> getBookItemResponses() {
        return bookItemResponses;
    }

    public void setBookItemResponses(List<BookItemResponse> bookItemResponses) {
        this.bookItemResponses = bookItemResponses;
    }

    @Override
    public String toString() {
        return "Book{" +
                "orderCd='" + orderCd + '\'' +
                ", distributorOrderRefer='" + distributorOrderRefer + '\'' +
                ", payTime=" + payTime +
                ", bookItemResponses=" + bookItemResponses +
                '}';
    }
}
